<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.io.*,java.text.*,java.util.*,java.sql.*,java.text.SimpleDateFormat,java.text.DateFormat,java.util.Date,javax.servlet.*,javax.servlet.http.*,DBstep.iDBManager2000.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
	<head>
		<title>正文</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=8" />
		<meta http-equiv="pragma" content="no-cache"/> 
        <meta http-equiv="cache-control" content="no-cache"/> 
        <meta http-equiv="expires" content="0"/>
	</head>
	<body bgcolor="#ffffff" onLoad="Load()" onUnload="UnLoad()">
		<input type="hidden" name="contextPath" id="contextPath" value="${pageContext.request.contextPath}" />
		<input type="hidden" name="comId" id="comId" value="${comId}" />
		<input type="hidden" name="appId" id="appId" value="${appId}" />
		<input type="hidden" name="ShowToolBar" id="ShowToolBar" value="${ShowToolBar}" />
		<input type="hidden" name="ShowMenu" id="ShowMenu" value="${ShowMenu}" />
		<input type="hidden" name="mFileName" id="mFileName" value="${mFileName}" />
		<input type="hidden" name="mServerUrl" id="mServerUrl" value="${mServerUrl}" />
		<input type="hidden" name="mUserName" id="mUserName" value="${mUserName}" />
		<input type="hidden" name="isInsert" id="isInsert" value="${isInsert}" />
		<!--引导和退出iWebOffice-->
		<div class="buttonbar clear w98 oa_bottom p5">
				<!--
				<input type=button value="无印章保存文件" class="oa_button fl ml5" onclick="SaveLocalNoSign()" />
				-->
				<!-- -->
				<input type=button value="页面设置" class="oa_button fl ml5" onclick="WebOpenPageSetup()" /> 
				<input type=button value="打开本地文件" class="oa_button fl ml5" onclick="WebOpenLocal()" />
				<input type=button value="存为本地文件" class="oa_button fl ml5" onclick="WebSaveLocal()" />
				
				<c:if test="${bflag=='1'}">								
					<input name="decrease" type="button" value="保存文档" onclick="WebSave()" class="oa_button fl ml5" id="save" />
				</c:if>

				<c:if test="${qflag=='1'}">
					<input type=button value="电子签章" onclick="CreateSignature(0)" class="oa_button fl ml5" />
					 
					<input type=button value="手写签名" onclick="CreateSignature(1)" class="oa_button fl ml5" />
					<input type=button value="签名印章" onclick="WebOpenSignature()" class="oa_button fl ml5" />
					<!---->
					<!-- 
					<input type=button class="oa_button fl ml5" value="印章彩色" onclick="webform.WebOffice.SignatureColor(true);" />
					<input type=button class="oa_button fl ml5" value="印章黑白" onclick="webform.WebOffice.SignatureColor(false);" /> 
					-->
				</c:if>
				
				<c:if test="${mflag=='1'}">
					<input name="decrease" type="button" value="套用模版定稿" onclick="WebInsertFile()" class="oa_button fl ml5" />
					<input type="button" value="清除痕迹" onclick="WebShow()" class="oa_button fl ml5" />
				</c:if>
				<input type=button value="打印文档" class="oa_button fl ml5" onclick="WebOpenPrint()" />
			
		</div>
		<form name="webform" id="webform" onSubmit="return SaveDocument();">
			<!--保存iWebOffice后提交表单信息-->
			<input type="hidden" name="RecordID" id="RecordID" value="${mRecordID}" />
			<input type="hidden" name="Subject" id="Subject" value="${title}"   />
			<input type="hidden" name="workId" id="workId" value="${workId}"  />
			<input type="hidden" name="Author" id="Author" value="${mUserName}"   />
			<input type="hidden" name="FileDate" id="FileDate" value="${mFileDate}"  />
			<input type="hidden" name="Template" id="Template" value="${mTemplate}"  />
			<input type="hidden" name="FileType" id="FileType" value="${mFileType}" />
			<input type="hidden" name="EditType" id="EditType" value="${mEditType}"  />
			<input type="hidden" name="HTMLPath" id="HTMLPath" value="${mRecordID}" />
			<input type="hidden" name="flag" id="flag" value="${flag}"  />
			<div  class="oa_list f4">
				<table border=0 cellspacing='0' cellpadding='0' width=100% height=100% align=center class="mail_list w98">
					<tr>
						<td class="TDStyle" height=90% colspan="4" valign="top">
							<table border=0 cellspacing='0' cellpadding='0' width='100%' height='100%'>
								<tr>
									<td bgcolor="menu" colspan="2">
										<!--调用iWebOffice，注意版本号，可用于升级-->
										 <OBJECT id="WebOffice" width="100%" height="500px" classid="clsid:8B23EA28-2009-402F-92C4-59BE0E063499" codebase="${mClientUrl}">
						                     <embed width="100%" height="100%"></embed>
						                </OBJECT>
						                <script src="${pageContext.request.contextPath}/workflow/webOffice/iSignatureAPI.js"></script>
									</td>
								</tr>
								<tr>
									<td bgcolor=menu height='15' colspan="2">
										<div id=StatusBar>
											状态栏
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
		</form>
	</body>
	<script type="text/javascript">
		var ctxPath = "${pageContext.request.contextPath}";
	</script>
	<script src="${pageContext.request.contextPath}/scripts/lib/jquery/jquery.min.js"></script>	
	<script language="javascript" for=WebOffice event="OnMenuClick(vIndex,vCaption)">
		if (vIndex==1){  
			WebOpenLocal();     //打开本地文件
		}
		if (vIndex==2){  
			WebSaveLocal();     //保存本地文件
		}
		if (vIndex==3){
			SaveDocument();     //保存正文到服务器上（不退出）
		}
		if (vIndex==5){  
			WebOpenSignature(); //签名印章
		}
		if (vIndex==6){  
			WebShowSignature(); //验证签章
		}
		if (vIndex==8){  
			WebSaveVersion();   //保存版本
		}
		if (vIndex==9){  
			WebOpenVersion();   //打开版本
		}
		if (vIndex==11){
			SaveDocument();     //保存正文到服务器上
			webform.submit();   //然后退出
		}
		if (vIndex==13){  
			WebOpenPrint();     //打印文档
		}
	</script>
	<script language=javascript for=WebOffice	event=OnToolsClick(vIndex,vCaption)>
	    //响应工具栏事件
	    if (vIndex==11){alert('编号:'+vIndex+'\n\r'+'标题:'+vCaption+'\n\r'+'请根据这些信息编写具体功能'+'\n\r\n\r'+'窗口状态:'+webform.WebOffice.WindowStatus);}
	    if (vIndex==12){webform.WebOffice.Alert('自定义工具栏测试');}
	    //if (vIndex==-1){webform.WebOffice.Alert(vCaption);}             //在完成相应操作后响应iWebOffice标准工具栏操作铵钮事件，如"手写批注",vCaption="手写批注"
	</script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/workflow/webOffice/js/editDoc.js"></script>

</html>
